package com.example.ruralservicedigitalplatform.mapper;


import com.example.ruralservicedigitalplatform.domain.dto.VillagerDto;
import com.example.ruralservicedigitalplatform.domain.po.Villager;
import com.example.ruralservicedigitalplatform.domain.vo.VillagerVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface VillagerMapper {
//    /**
//     * 村民登录
//     * @param villagerDto
//     * @return
//     */
//    @Select("select * from villager where villager_name=#{villagerName} and password=#{password}")
//    Villager getByUsernameAndPassword(VillagerDto villagerDto);
//
//    /**
//     * 村民注册
//     * @param villager
//     */
//    @Insert(" insert into villager(villager_name,age, image,password, phone_number, gender, id_number, create_time, update_time) " +
//                         "values (#{villagerName},#{age},#{image},#{password},#{phoneNumber},#{gender},#{idNumber},#{createTime,},#{updateTime})")
//    void register(Villager villager);
//
//    /**
//     * 编辑信息
//     * @param villager
//     */
//    void update(Villager villager);
//
//    /**
//     * 查询本人信息
//     * @param
//     * @return
//     */
//    @Select("select villager_name,gender,phone_number,age,image,id_number,address,password from villager where villager_id=#{villagerId}")
//    VillagerVO selectById(Long id);
    /**
     * 根据openid查询村民用户
     * @param openid
     * @return
     */
    @Select("select * from villager where openid=#{openid}")
    Villager getById(String openid);

    /**
     *插入数据
     * @param villager
     */
    void insert(Villager villager);
}